-- GENERATED SPELL FOR [Infectious Ghoul] --


function spell0_16244(pUnit, Event) --@Flesh Rot,n/a--
pUnit:FullCastSpellOnTarget(29915,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16244', 12000, 1)
end

function spell1_16244(pUnit, Event) --@Flesh Rot,n/a--
pUnit:FullCastSpellOnTarget(54709,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16244', 12000, 1)
end

function spell2_16244(pUnit, Event) --@Frenzy,Self--
pUnit:FullCastSpellOnTarget(54701,pUnit)
pUnit:RegisterEvent('Sorts_16244', 633, 1)
end

function spell3_16244(pUnit, Event) --@Rend,n/a--
pUnit:FullCastSpellOnTarget(54703,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16244', 15000, 1)
end

function spell4_16244(pUnit, Event) --@Rend,n/a--
pUnit:FullCastSpellOnTarget(54708,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16244', 15000, 1)
end

function Sorts_16244(pUnit, Event)
local choix_sorts_16244 = math.random(0, 4)
if choix_sorts_16244 == 0 then
pUnit:RegisterEvent('spell0_16244', 1, 1)
end
if choix_sorts_16244 == 1 then
pUnit:RegisterEvent('spell1_16244', 1, 1)
end
if choix_sorts_16244 == 2 then
pUnit:RegisterEvent('spell2_16244', 1, 1)
end
if choix_sorts_16244 == 3 then
pUnit:RegisterEvent('spell3_16244', 1, 1)
end
if choix_sorts_16244 == 4 then
pUnit:RegisterEvent('spell4_16244', 1, 1)
end
end

function mob16244_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_16244', math.random(1500, 3000), 1)
end

function mob16244_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16244_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16244_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(16244, 1, 'mob16244_Action')
RegisterUnitEvent(16244, 2, 'mob16244_Leave')
RegisterUnitEvent(16244, 3, 'mob16244_Kill')
RegisterUnitEvent(16244, 4, 'mob16244_Die')
